<template>
  <div class="container pt-24 max-w-7xl">
    <Title></Title>
    <div class="animate-slide-down-fade-in">
      <h2 class="text-3xl font-semibold text-foreground py-2">目录</h2>
      <div class="border-b border-dashed"></div>
      <ul class="list-disc">
        <div v-for="item in tocTree" :key="item.title" class="my-2">
          <div class="group py-2 text-xl font-semibold">
            <a :href="'#' + item.title" class="opacity-0 group-hover:opacity-100 cursor-pointer mr-2 -ml-4 text-primary transition-all duration-300">#</a>
            <h3 :id="item.title" class="inline-block scroll-mt-[70px] scroll-smooth cursor-pointer hover:text-primary underline-animation transition-all duration-300">
              {{ item.title }} <!--一级标题-->
            </h3>
          </div>
          <div class="border-b border-dashed"></div>
          <ul v-if="item.children" class="list-disc pl-4">
            <div v-for="child in item.children" :key="child.title" class="my-2">
              <div class="flex space-x-2 hover:fill-secondary hover:stroke-primary transition-all duration-300">
                <svg class="h-6 w-6 cursor-pointer fill-secondary stroke-2" stroke-linecap="round" stroke-linejoin="round">
                  <circle cx="12" cy="12" r="8" />
                  <path d="m8 13 2.165 2.165a1 1 0 0 0 1.521-.126L16 9" fill="none" />
                </svg>
                <span class="font-medium cursor-pointer hover:text-primary transition-all duration-300">{{ child.title }}</span> <!--二级标题-->
              </div>
              <ul v-if="child.children" class="list-disc pl-4 flex flex-wrap">
                <span class="py-1 px-2 m-2 text-primary bg-secondary rounded-md cursor-pointer hover:bg-primary hover:text-background transition-all duration-300" v-for="subChild in child.children" :key="subChild.title"> 
                  {{ subChild.title }} <!--三级标题-->
                </span>
              </ul>
            </div>
          </ul>
        </div>
      </ul>
    </div>
  </div>
</template>

<script lang="ts" setup>
// import { ref, onMounted, onUnmounted } from 'vue'
// import { Sun, SunMoon, Moon, Search, FolderOpen, Tags, BookOpenText, CalendarDays  } from 'lucide-vue-next'
import Title from "@/components/own/title/Title.vue";

const tocTree = [
  {
    title: "01 Java",
    children: [
      { title: "Java锁之ReentrantLock（源码详解）" },
      {
        title: "1:多线程",
        children: [
          {
            title:
              "【初】Java线程池运行原理，线程池源码解读【Java线程池学习二】",
          },
          { title: "【初】线程池最优使用策略【Java线程池学习一】" },
          { title: "【初】Java线程池详解" },
        ],
      },
      {
        title: "2:集合",
        children: [
          { title: "【初】ArrayList扩容机制源码分析" },
          { title: "【初】HashMap扩容机制源码分析" },
          { title: "【初】ConcurrentHashMap之put源码阅读" },
        ],
      },
    ],
  },
  {
    title: "02 SSM",
    children: [
      {
        title: "1:Spring",
        children: [
          { title: "【中】同一个Service内部调用开启事务" },
          {
            title:
              "【中】一文弄懂@Async代理执行原理（从源码的角度深入理解@EnableAsync 注解开启原理）",
          },
          {
            title:
              "【中】Java全局异常处理，@ControllerAdvice异常拦截原理解析【简单易懂】",
          },
          { title: "【中】Spring使用@Transactional 管理事物，Java事物详解" },
          { title: "【中】Spring事务源码解析【一次一篇文章弄懂】" },
          {
            title:
              "【中】SpringBoot 热插拔AOP，动态的实现AOP【简单易懂，有大用】",
          },
        ],
      },
      {
        title: "2:SpringBoot",
        children: [{ title: "【初】SpringBoot使用异步无法获取自定义注解" }],
      },
      {
        title: "3:SpringMVC",
        children: [
          {
            title:
              "【初】HTTP执行流程，SpringMVC执行流程，Java一次HTTP请求容器做了哪些事情，过滤器、拦截器、AOP执行流程",
          },
        ],
      },
      {
        title: "4:MyBatis/MyBatis-Plus",
        children: [
          { title: "【中】基于MyBatis二级缓存深入装饰器模式" },
          { title: "【初】深入理解MyBatis一级缓存和二级缓存" },
          { title: "【初】MyBatis 执行原理" },
          {
            title:
              "【初】MyBatis-Plus 使用枚举参数异常， SpringBoot枚举参数异常",
          },
          { title: "【中】全新的ORM框架——BeetlSQL介绍" },
        ],
      },
    ],
  },
  {
    title: "03 SSM",
    children: [
      {
        title: "1:Spring",
        children: [
          { title: "【中】同一个Service内部调用开启事务" },
          {
            title:
              "【中】一文弄懂@Async代理执行原理（从源码的角度深入理解@EnableAsync 注解开启原理）",
          },
          {
            title:
              "【中】Java全局异常处理，@ControllerAdvice异常拦截原理解析【简单易懂】",
          },
          { title: "【中】Spring使用@Transactional 管理事物，Java事物详解" },
          { title: "【中】Spring事务源码解析【一次一篇文章弄懂】" },
          {
            title:
              "【中】SpringBoot 热插拔AOP，动态的实现AOP【简单易懂，有大用】",
          },
        ],
      },
      {
        title: "2:SpringBoot",
        children: [{ title: "【初】SpringBoot使用异步无法获取自定义注解" }],
      },
      {
        title: "3:SpringMVC",
        children: [
          {
            title:
              "【初】HTTP执行流程，SpringMVC执行流程，Java一次HTTP请求容器做了哪些事情，过滤器、拦截器、AOP执行流程",
          },
        ],
      },
      {
        title: "4:MyBatis/MyBatis-Plus",
        children: [
          { title: "【中】基于MyBatis二级缓存深入装饰器模式" },
          { title: "【初】深入理解MyBatis一级缓存和二级缓存" },
          { title: "【初】MyBatis 执行原理" },
          {
            title:
              "【初】MyBatis-Plus 使用枚举参数异常， SpringBoot枚举参数异常",
          },
          { title: "【中】全新的ORM框架——BeetlSQL介绍" },
        ],
      },
    ],
  },
  {
    title: "04 SSM",
    children: [
      {
        title: "1:Spring",
        children: [
          { title: "【中】同一个Service内部调用开启事务" },
          {
            title:
              "【中】一文弄懂@Async代理执行原理（从源码的角度深入理解@EnableAsync 注解开启原理）",
          },
          {
            title:
              "【中】Java全局异常处理，@ControllerAdvice异常拦截原理解析【简单易懂】",
          },
          { title: "【中】Spring使用@Transactional 管理事物，Java事物详解" },
          { title: "【中】Spring事务源码解析【一次一篇文章弄懂】" },
          {
            title:
              "【中】SpringBoot 热插拔AOP，动态的实现AOP【简单易懂，有大用】",
          },
        ],
      },
      {
        title: "2:SpringBoot",
        children: [{ title: "【初】SpringBoot使用异步无法获取自定义注解" }],
      },
      {
        title: "3:SpringMVC",
        children: [
          {
            title:
              "【初】HTTP执行流程，SpringMVC执行流程，Java一次HTTP请求容器做了哪些事情，过滤器、拦截器、AOP执行流程",
          },
        ],
      },
      {
        title: "4:MyBatis/MyBatis-Plus",
        children: [
          { title: "【中】基于MyBatis二级缓存深入装饰器模式" },
          { title: "【初】深入理解MyBatis一级缓存和二级缓存" },
          { title: "【初】MyBatis 执行原理" },
          {
            title:
              "【初】MyBatis-Plus 使用枚举参数异常， SpringBoot枚举参数异常",
          },
          { title: "【中】全新的ORM框架——BeetlSQL介绍" },
        ],
      },
    ],
  }
];
</script>

<style scoped>

</style>